//
// Created by 11518 on 2024/11/26.
//

#include "timer.h"
#include <numeric>

Timer::Timer() {
    m_StartTime = std::time(0);
}

void Timer::restart() {
    m_StartTime = std::time(0);
}

double Timer::elapsed()const{

    return double(time(0) - m_StartTime);
}

double Timer::elapsedMin() const {
    return double(1)/double(CLOCKS_PER_SEC);
}

double Timer::elapsedMax() const {
    return (double((std::numeric_limits<std::clock_t>::max)()) - double(m_StartTime))/double(CLOCKS_PER_SEC);
}

